package com.peng.community.mapper;

import com.peng.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommentMapper {

    List<Comment> findCommentsByEntity(@Param("entityType") int entityType,
                                       @Param("entityId") int entityId, @Param("offset") int offset, @Param("limit") int limit);

    int findCountCommentsByEntity(@Param("entityType") int entityType,
                                  @Param("entityId") int entityId);

    int insertComment(Comment comment);

    Comment findCommentsById(@Param("id") int id);

}
